package org.wen.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.wen.entity.UserInfo;
import org.wen.service.UserInfoService;

@RestController
@RequestMapping("/userinfo")
public class UserInfoController {

    @Autowired
    private UserInfoService userInfoService;
    @GetMapping("/get")
    public UserInfo get(int id){
        return userInfoService.selectByPrimaryKey(id);
    }


    @GetMapping("/add")
    public String add(){
        UserInfo userInfo = new UserInfo();
        userInfo.setName("aa");
        userInfo.setPassword("3333333");
        userInfoService.add(userInfo);
        return "操作成功！";
    }

}
